<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .active {
      color: red;
    }
  </style>
</head>

<body>
  <div id="app">
    <!-- <hz v-bind:class="(类名1: bool, 类名2: bkool2)">，</h2>-- -->
    <h2 v-bind:class="{active:isactive,line:isline}">奶发</h2> <!--  绑定选择class -->
    <button v-on:click="iscolor">颜色</button> <!-- 绑定按钮点击 -->
    <h2 class="title" v-bind:class="['isactive','isline',bianling]">奶发</h2><!-- class数组绑定 -->
    <h2 class="title" v-bind:class="getClass()">奶发</h2>
  </div>

  <script src="../js/vue.js"></script>
  <script>
    let app = new Vue({
      el: '#app',  //先定义抓取id
      data: {
        counter: 0,
        isactive: true,
        isline: true,
        bianling:'aaa',
        imgURL: 'https://img30.360buyimg.com/sku/jfs/t1/119312/24/8486/464366/5ecfaafcE74d9a7c3/ea334acfe78be07d.png',

      },

      methods: {
        iscolor: function () {
          this.isactive = !this.isactive;
        },
        getClass:function(){
          return[this.isactive,this.bianling];

        }

      }
    })
  </script>
</body>

</html>